'''
Created on 2013-6-23

@author: ZuoPeng
'''
from fractions import gcd

class P73(object):
    '''
    classdocs
    '''


    def __init__(self):
        '''
        Constructor
        '''
    def calc(self):
        result=0
        for d in range(4, 12001):
            for n in range(1, d):
                if n / d > 1 / 3 and n / d < 1 / 2:
                    if gcd(n, d) == 1:
                        result += 1
            if d//100==d/100:
                print(d)
        return result

A=      P73()
print(A.calc())
